using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Windows.Forms;
using System.Drawing;
using System.Resources;
using ENT_Entidades;

namespace CTRL
{
    public abstract class Controlador
    {
        #region propiedades
        public enum Accion
        {
            ver = 0,
            modificar = 1
        }
        #endregion propiedades
        public void SettingPantalla(string tit, int h, int a)
        {
            //Titulo = tit;
            //alto = h;
            //ancho = a;
        }
        public void SettingPantalla(string tit)
        {
            SettingPantalla(tit, 600, 800);
        }
        private string _Titulo;

        public string Titulo
        {
            get { return _Titulo; }
        }
        private int _alto;

        public int Alto
        {
            get { return _alto; }
        }
        private int _ancho;

        public int Ancho
        {
            get { return _ancho; }
        }

        public abstract DialogResult mostrarPantalla(clsOID _OID);
        public abstract DialogResult mostrarPantallaDialogo(clsOID _OID);
        protected abstract void inicializar();
        protected abstract void inicializar(Form _frm);

        public void Cerrar(Form frm)
        {
            frm.Close();
        }

        public void activarForm(Form frm)
        {
            frm.Opacity = 1.0;
        }

        public void desactivarForm(Form frm)
        {
            frm.Opacity = 0.5;
        }

        public Image getImagen(Accion accion)
        {
            ResourceManager rec = new ResourceManager("CTRL.Imagenes",typeof(Controlador).Assembly);
            return (Image)rec.GetObject(accion.ToString());
        }

        public void LlenarTipoDocumento(ref ComboBox cbo)
        {
            cbo.Items.Clear();
			cbo.Items.Add("D.N.I.");
            cbo.Items.Add("L.C.");
			cbo.Items.Add("L.E.");
			cbo.Items.Add("C.E.");
        }

        protected clsOID _OID;

        public clsOID OID_Pantalla
        {
            get { return _OID; }
            set { _OID = value; }
        }
    }
}
